<?php
$installer = $this;
$installer->startSetup();
$installer->run("

/*Data for the table `rumall_promote_events` */

DROP TABLE IF EXISTS `rumall_promote_events`;
CREATE TABLE `rumall_promote_events` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `event_title` varchar(100) DEFAULT NULL COMMENT '活动主题',
  `event_code` varchar(64) DEFAULT NULL COMMENT '活动标识代码',
  `from_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
  `to_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '结束时间',
  `is_active` tinyint(1) unsigned DEFAULT '0' COMMENT '状态,0是disabled, 1是enabled',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


/*Data for the table `rumall_promote_events_category` */

DROP TABLE IF EXISTS `rumall_promote_events_category`;
CREATE TABLE `rumall_promote_events_category` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `category_title_en` varchar(64) DEFAULT NULL COMMENT '英文分类名称',
  `category_title_ru` varchar(64) DEFAULT NULL COMMENT '俄文分类名称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


/*Data for the table `rumall_promote_events_product` */

DROP TABLE IF EXISTS `rumall_promote_events_product`;
CREATE TABLE `rumall_promote_events_product` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `p_id` int(10) unsigned DEFAULT NULL COMMENT '主表rumall_promote_events的id',
  `event_category_id` int(10) unsigned DEFAULT NULL COMMENT '分类表的id',
  `status` tinyint(1) unsigned DEFAULT NULL COMMENT '审核状态',
  `product_sku` varchar(64) DEFAULT NULL COMMENT '产品SKU',
  `is_sub_product` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否子产品',
  `price` float(10,4) DEFAULT NULL COMMENT '产品价格',
  `special_price` float(10,4) DEFAULT NULL COMMENT '产品特价',
  `discount` float(10,4) DEFAULT NULL COMMENT '折扣比例',
  `inventory` int(10) unsigned DEFAULT NULL COMMENT '库存',
  `is_recommand` tinyint(1) unsigned DEFAULT NULL COMMENT '是否主推',
  `priority` int(10) unsigned DEFAULT NULL COMMENT '优先级',
  `sort` int(10) unsigned DEFAULT NULL COMMENT '排序',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    

");
$installer->endSetup();